binary arithmetic operators
The binary arithmetic operators are ** , / , * , - , + , \ , MOD.
**
** , the raise to power operator, raises the left operand to the power of the right
operand. ** replaces the ^ in conventional BASIC because ^ is bitwise XOR.
/
/ , the floating point divide operator, divides the left operand by the right operand. /
is a floating point divide, so if either operand is an integer type, it is converted to
DOUBLE before the operation is performed. The result of / is SINGLE if both operands
are SINGLE , otherwise it is DOUBLE . / will also divide SCOMPLEX and DCOMPLEX
numbers.
*
* , the multiply operator, multiplies the left operand by the right operand. * will
also multiply SCOMPLEX and DCOMPLEX numbers.
-
- , the subtract operator, subtracts the right operand from the left operand. - will
also subtract SCOMPLEX and DCOMPLEX numbers.
+
+ , the add operator, adds the right numeric operand to the left numeric operand. +
will also add SCOMPLEX and DCOMPLEX numbers. + will also concatenate strings - see Binary
String Operators.
\
\ , the integer divide operator, divides the left operand by the right operand. \ is
an integer divide, so if either operand is a floating point type, it is converted to SLONG
before the operation is performed. The result of \ is always SLONG or XLONG or
GIANT.
MOD
MOD , the integer modulus operator, divides the left
operand by the right operand, but returns the remainder left over from the divide instead
of the result of the divide. MOD is defined to
use an integer divide, so if either operand is a floating point type, it is converted to
SLONG before the operation is performed. The result of MOD is always SLONG or XLONG or GIANT.